package com.woniuxy.Controller;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.woniuxy.entity.RbacRole;
import com.woniuxy.entity.RbacRoleDto;
import com.woniuxy.entity.RbacRoleMenuDto;
import com.woniuxy.service.RbacRoleMenuService;
import com.woniuxy.service.RbacRoleService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;


/**
 * (RbacRole)表控制层
 *
 * @author makejava
 * @since 2021-04-25 23:04:56
 */
@RestController
@RequestMapping("rbacRoleMenu")
public class RbacRoleMenuController {
    /**
     * 服务对象
     */
    @Resource
    private RbacRoleMenuService rbacRoleMenuService;
    @RequestMapping("insert")
    public String insertRoleMenu(@RequestBody RbacRoleMenuDto rbacRoleMenuDto){
       return rbacRoleMenuService.insertRoleMenu(rbacRoleMenuDto.getRoleid(),rbacRoleMenuDto.getMenuid())+"";
    }
    /**
     * Description : 通过角色id 查询所拥有的权限id  <br/>
     * ChangeLog : 1. 创建 (2021/4/29 14:38 [mayuhang]);
     *
     * @return java.lang.String
     **/
    @GetMapping("findOne/{id}")
    public List<Integer> findOneRole(@PathVariable("id") int id){
        return rbacRoleMenuService.findOneRole(id);
    }
}
